package com.fegin.Hystrix.app;

import com.fegin.bean.app.StockUser;
import com.fegin.client.app.StockUserFegin;
import com.util.Respons.ResponseUtil;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author 张子艺
 * @packge com.fegin.Hystrix
 * @data 2019-02-19 14:00
 * @project CurrenCy-Cloud
 */
@Component
public class StockUserFeginHystrix implements FallbackFactory<StockUserFegin> {


    @Override
    public StockUserFegin create(Throwable throwable) {
        return new StockUserFegin() {
            @Override
            public Map<String, Object> login(String account, String pswd) {
                return ResponseUtil.getExceptionMap();
            }

            @Override
            public Map<String, Object> insertOrUpdate(StockUser stockUser) {
                return ResponseUtil.getExceptionMap();
            }
        };
    }
}
